package com.gdssoft.pdaweb.dao.impl;

/*
 *  捷达世软件(深圳)有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
 */

import com.gdssoft.core.dao.impl.BaseDaoImpl;
import com.gdssoft.pdaweb.dao.PdaMdAssetInfoDao;
import com.gdssoft.pdaweb.model.PdaMdAssetInfo;

@SuppressWarnings("unchecked")
public class PdaMdAssetInfoDaoImpl extends BaseDaoImpl<PdaMdAssetInfo> 
	implements PdaMdAssetInfoDao {
	
	public PdaMdAssetInfoDaoImpl() {
		super(PdaMdAssetInfo.class);
	}

	@Override
	public PdaMdAssetInfo getByBarCode(String barCode) {
		return (PdaMdAssetInfo)findUnique("from PdaMdAssetInfo where barCode=?",
					new Object[]{barCode});
	}
	@Override
	public PdaMdAssetInfo getByAssetNumAndSiteId(String assetNum,String siteId) {
		String hql = "from PdaMdAssetInfo where assetNo=? and siteId =?";
		//List<PdaMdAssetInfo> list = new ArrayList<PdaMdAssetInfo>();
		return (PdaMdAssetInfo) findUnique(hql, new String[]{assetNum,siteId});
	}
	
}
